#include <QtOpenGL>

class GLWidget : public QGLWidget
{
public:
    GLWidget(QWidget *parent);
    ~GLWidget();
    void initializeGL() override;
    void resizeGL(int w, int h) override;
    void paintGL() override;
    void timerEvent(QTimerEvent *) override { update(); }
    void mousePressEvent(QMouseEvent *) override { killTimer(timerId); }
    void mouseReleaseEvent(QMouseEvent *) override { timerId = startTimer(20); }

    void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp);

private:
    GLfloat rot[3], xOffs[3], yOffs[3], xInc[3];
    GLuint pbufferList;
    GLuint cubeTexture;
    int timerId;

    QGLFramebufferObject *fbo;
};

